Re: Query kill - Mailing list pgsql-sql

From eric soroos
Subject Re: Query kill
Date
Msg-id 57020238.1185653165@[4.42.179.151]
Whole thread Raw
In response to Re: Query kill  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-sql
On Fri, 12 Jul 2002 01:01:31 -0400 (EDT) in message <200207120501.g6C51Vo14062@candle.pha.pa.us>, Bruce Momjian
<pgman@candle.pha.pa.us>wrote:
 
> Rudi Starcevic wrote:
> > Hello,
> > 
> > If I write a query that is inefficient or in an eternal loop how
> > do I stop it without restarting the postmaster ?
> > 
> > I can see many postmaster processed appearing in the output of the 'ps' 
> > command.
> > Do I need to stop/kill them all or can I stop just the query I want ?
> 
> Just send a SIGINT to the process. That simulates a ^C, which works too
> from the client like psql.

Is there a way to deny permission for certain users to execute a query that exceeds some expected cost?

For example, I have a query builder from user input that could produce a query that ends up doing something that the
queryplanner thinks will take 8M units of work. Generally, this is an unconstrained join between my biggest tables, a
resultthat is neither fast nor useful.
 

If I could set a threshold of 1M units for the webapp user, I could trap this sort of thing before they cause quality
ofservice issues. 
 

eric




pgsql-sql by date:

Previous
From: Dmitry Tkach
Date:
Subject: It is a bug in pred_test()! (Was: Please, HELP! Why is the query plan so wrong???)
Next
From: Jan Wieck
Date:
Subject: Re: Query kill